<?php 
class fileRemoveAction extends AdminMasterUploadControl{
	public function execute($request){
		//check authentiaction
		$directory_path  	= $request->getParameter('path','');
		$name				= $request->getParameter('name','');
		$json = array('status' => 'error');
		if($directory_path == 'all') $directory_path = '';
		$path = sfConfig::get('sf_upload_dir').'/'.$directory_path.'/'.$name;
		if(file_exists($path)){
			@unlink($path);
			$json['status'] = 'success';
		}
		print_r(json_encode($json));
		return sfView::NONE;
	}
}